/*    */ package com.newcrm.webapi.sub;
/*    */ 
/*    */ import com.newcrm.exception.NotFoundException;
/*    */ import com.newcrm.webapi.AbstractHttpServlet;
/*    */ import java.io.IOException;
/*    */ import java.io.PrintWriter;
/*    */ import javax.servlet.ServletException;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import javax.servlet.http.HttpServletResponse;
/*    */ import org.apache.log4j.Logger;
/*    */ import org.jsoup.Connection;
/*    */ import org.jsoup.Connection.Method;
/*    */ import org.jsoup.Connection.Response;
/*    */ import org.jsoup.Jsoup;
/*    */ 
/*    */ public class ShowPhoneArea extends AbstractVOIPReport
/*    */ {
/* 27 */   private static Logger logger = Logger.getLogger(ShowPhoneArea.class
/* 28 */     .getName());
/*    */ 
/*    */   public ShowPhoneArea(AbstractHttpServlet servlet)
/*    */   {
/* 31 */     super(servlet);
/*    */   }
/*    */ 
/*    */   public void parse(HttpServletRequest request, HttpServletResponse response)
/*    */     throws IOException, ServletException, NotFoundException
/*    */   {
/* 41 */     String phone = request.getParameter("phone");
/*    */ 
/* 43 */     String url = "http://cx.shouji.360.cn/phonearea.php?number=" + phone;
/*    */ 
/* 45 */     response.setContentType("text/html;charset=utf-8");
/* 46 */     PrintWriter out = response.getWriter();
/*    */     try
/*    */     {
/* 50 */       Connection.Response resp = Jsoup.connect(url).userAgent("Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; GTB6.6; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; Tablet PC 2.0; .NET CLR 1.1.4322; .NET4.0C)")
/* 51 */         .timeout(10000).method(Connection.Method.GET).execute();
/*    */ 
/* 53 */       out.println(resp.body());
/* 54 */       out.flush();
/* 55 */       out.close();
/* 56 */       return;
/*    */     } catch (IOException e) {
/* 58 */       logger.warn("get phone area info failed", e);
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.sub.ShowPhoneArea
 * JD-Core Version:    0.6.1
 */